<?php 
namespace app\seller\validate;
use think\validate;
class ShippingValidate extends Validate{
    //验证规则
    protected $rule = array(
		'shipping_code' => 'max:20',
		'shipping_name' => 'max:120',
		'shop_id'=>'number',
		'shipping_desc' => 'max:255',
    	);
    //验证失败提示信息
    protected $message = array(
		'shipping_code.max'=>'快递代号的值不能超过20个字符',
		'shipping_name.max'=>'快递名称的值不能超过120个字符',
		'shop_id.number'=>'店铺ID的值必须是一个整数',
		'shipping_desc.max'=>'描述的值不能超过255个字符',
);
    //验证场景
    protected $scene = array(
		'add'=>array('shipping_code','shipping_name','shop_id','shipping_desc','enabled'),
		'edit'=>array('shipping_id','shipping_code','shipping_name','shop_id','shipping_desc','enabled'),
	);

}